package com.demo.domain.ro;

import com.demo.domain.TeamComposition;
import com.demo.domain.TeamProfile;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.sql.Date;
import java.util.List;

@Data
public class OrganizeTeamRequest {
    private Long tpId;
    private Long tpUid;
    private String tpUrealname;
    private String tpTeamName;
    private String tpProjectName;
    private Integer tpNeedStudentNumber;//招募学生人数
    private Integer tpMemberNumber;//现有学生人数
    private Integer tpDifference;//缺少学生人数
    private Integer tpTeacherNumber;//教师人数

    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date tpRegistrationDeadline;
    private String tpContact;
    private String tpTeacherName;
    private String tpTeamIntro;
    private String tpAbilityNeed;
    private int tpAlive;
    TeamProfile teamProfile;
    List<TeamComposition> compositionList;

    public TeamProfile getTeamProfile(){
        if (teamProfile==null){
            teamProfile=new TeamProfile();
            teamProfile.setTpTeamName(tpTeamName);
            teamProfile.setTpProjectName(tpProjectName);
            teamProfile.setTpNeedStudentNumber(tpNeedStudentNumber);
            teamProfile.setTpTeacherNumber(tpTeacherNumber);
            teamProfile.setTpRegistrationDeadline(tpRegistrationDeadline);
            teamProfile.setTpContact(tpContact);
            teamProfile.setTpTeamIntro(tpTeamIntro);
            teamProfile.setTpAbilityNeed(tpAbilityNeed);
        }
        return teamProfile;
    }


    @Override
    public String toString() {
        return "OrganizeTeamRequest{" +
                "teamProfile=" + getTeamProfile() +
                ", compositionList=" + compositionList +
                '}';
    }
}
